<?php TPL::output('global/header_meta.tpl.htm'); ?>
<div class="aw-top-menu-wrap">
<div class="container">
<!-- logo -->
<div class="aw-logo hidden-xs">
<a href="<?php echo base_url(); ?>"></a>
</div>
<!-- end logo -->
<!-- 搜索框 -->
<div class="aw-search-box  hidden-xs hidden-sm">
<form class="navbar-search" action="search/" id="global_search_form" method="post">
<input class="form-control search-query" type="text" placeholder="<?php _e('搜索问题、话题或人'); ?>" autocomplete="off" name="q" id="aw-search-query" />
<span title="<?php _e('搜索'); ?>" id="global_search_btns" onClick="$('#global_search_form').submit();"><i class="icon icon-search"></i></span>
<div class="aw-dropdown">
<div class="mod-body">
<p class="title"><?php _e('输入关键字进行搜索'); ?></p>
<ul class="aw-dropdown-list hide"></ul>
<p class="search"><span><?php _e('搜索'); ?>:</span><a onClick="$('#global_search_form').submit();"></a></p>
</div>
<div class="mod-footer">
<a href="<?php if (get_setting('quick_publish') == 'Y' && $this->user_id) { ?>javascript:;<?php } else { ?>publish<?php } ?>" onClick="$('#header_publish').click();" class="pull-right btn btn-mini btn-success publish"><?php _e('发起问题'); ?></a>
</div>
</div>
</form>
</div>
<!-- end 搜索框 -->
<!-- 导航 -->
<div class="aw-top-nav navbar">
<div class="navbar-header">
<button  class="navbar-toggle pull-left">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<nav role="navigation" class="collapse navbar-collapse bs-navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="home/" ><i class="icon icon-home"></i>动态</a></li>
<li><a href="question/" ><i class="icon icon-users"></i>讨论</a></li>
<li><a href="article/"><i class="icon icon-ul"></i> <?php _e('文章'); ?></a></li>
<li><a href="topic/"><i class="icon icon-topic"></i> <?php _e('话题'); ?></a></li>
<?php if ($this->user_id) { ?>
<li>
<a href="notifications/" class="<?php if ($_GET['app'] == 'notifications') { ?>active<?php } ?>"><i class="icon icon-bell"></i> <?php _e('通知'); ?></a>
<span class="badge badge-important" style="display:none" id="notifications_unread"><?php echo $this->user_info['notification_unread']; ?></span>
<div class="aw-dropdown pull-right hidden-xs">
<div class="mod-body">
<ul id="header_notification_list"></ul>
</div>
<div class="mod-footer">
<a href="notifications/"><?php _e('查看全部'); ?></a>
</div>
</div>
</li>
<?php } ?>
</ul>
</nav>
</div>
<!-- end 导航 -->
<!-- 用户栏 -->
<div class="aw-user-nav">
<!-- 登陆&注册栏 -->
<?php if ($this->user_id) { ?>
<a href="people/<?php echo $this->user_info['url_token']; ?>" class="aw-user-nav-dropdown">
<img alt="<?php echo $this->user_info['user_name']; ?>" src="<?php echo get_avatar_url($this->user_info['uid'], 'mid'); ?>" />
<?php echo $this->user_info['user_name']; ?>
<?php if ($this->user_info['inbox_unread'] != 0) {?>
<span class="badge badge-important"><?php echo $this->user_info['inbox_unread']?></span>
<?php } ?>
</a>
<div class="aw-dropdown dropdown-list pull-right">
<ul class="aw-dropdown-list">
<li><a href="inbox/"><i class="icon icon-inbox"></i> <?php _e('私信'); ?><span class="badge badge-important hide" id="inbox_unread">0</span></a></li>
<li class="hidden-xs"><a href="account/setting/profile/"><i class="icon icon-setting"></i> <?php _e('设置'); ?></a></li>
<?php if ($this->user_info['permission']['is_administortar'] OR $this->user_info['permission']['is_moderator']) { ?>
<li class="hidden-xs"><a href="admin/"><i class="icon icon-job"></i> <?php _e('管理'); ?></a></li>
<?php } ?>
<li><a href="account/logout/">
<i class="icon icon-logout"></i> <?php _e('退出'); ?></a>
</li>
</ul>
</div>
<?php } else { ?>
<span class="aw-user-login-nav" >
<a href="account/login/"><?php _e('登陆'); ?></a>
<a href="account/register/"><?php _e('注册'); ?></a>
</span>
<?php } ?>
<!-- end 登陆&注册栏 -->
</div>
<!-- end 用户栏 -->
 <!-- 发起 -->
<?php if ($this->user_id) { ?>
<?php if($this->user_info['verified'] == 'personal') { ?>
<div class="aw-publish-btn">
	<a class="btn-primary" href="qiandao/"><i class="icon icon-qiandao"></i>签到</a>
</div>
<?php } ?>
<div class="aw-publish-btn">
<a id="header_publish"  rel="nofollow" <?php if ($this->user_id) { ?>href="publish/"  onclick="AWS.dialog('publish', {'category_enable':'<?php echo (get_setting('category_enable') == 'Y') ? '1' : '0'; ?>', 'category_id':'<?php echo intval($_GET['category']); ?>', 'topic_title':'<?php echo $this->topic_info['topic_title']; ?>'}); return false;" <?php } else{?>href="account/login/" 	<?php } ?> class="btn-primary" ><i class="icon icon-ask"></i><?php _e('发起'); ?></a>
<div class="dropdown-list pull-left">
<ul>
<li><a href="publish/"><?php _e('问题'); ?></a></li>
<li><a href="publish/article/"><?php _e('文章'); ?></a></li>
</ul>
</div>
</div>
<?php } ?>
<!-- end 发起 -->
</div>
</div>
<?php if ($this->user_id AND $this->user_info['email'] AND !$this->user_info['valid_email']) { ?>
<div class="aw-email-verify">
<div class="container text-center">
你的邮箱 <?php echo $this->user_info['email']; ?> 还未验证 , 请尽快查收邮件.
</div>
</div>
<?php } ?>

